package com.itheima.algorithm.recursion_single;

/**
 * 递归求阶乘
 */
public class E01Factorial {


    /**
     * 递归求阶乘
     *
     * @param n n
     * @return int
     */
    public static int fn(int n) {
        if (n == 1) {
            return 1;
        }
        return n * fn(n - 1);
    }

    public static void main(String[] args) {
        int f = fn(10);
        System.out.println(f);
    }


}
